﻿using System;
using System.Web.UI;
using UDS.Components;

namespace UDS.Inc
{
    /// <summary>
    /// ControlHeader 的摘要说明。
    /// </summary>
    public partial class ControlHeader : Page
    {
        protected override void OnLoad(EventArgs e)
        {
            BBSClass bbsclass = new BBSClass();
            
            //显示系统公告
            using (var dr_sysbulletin = bbsclass.GetDeskTopBulletin())
            {
                var innerstring = "";
                while (dr_sysbulletin.Read())
                {
                    innerstring += "<a href='../SubModule/UnitiveDocument/BBS/Display.aspx?BoardID=" + dr_sysbulletin["board_id"] + "&ItemID=" + dr_sysbulletin["item_id"] + "' target='_blank' title='" + dr_sysbulletin["content"] + "'>" + dr_sysbulletin["title"] + "</a>&nbsp;";
                }
                sys_bulletin.InnerHtml = innerstring;
            }

            base.OnLoad(e);
        }

#if false
        private string GetTime(object day)
        {
            if (day.ToString() == "")
                return "";

            return (DateTime.Parse(day.ToString()).ToShortTimeString());
        }
#endif
    }
}